<template>
  <div class="p2">Service</div>
</template>
 
<script lang = 'ts'>
// import Vue from 'vue'
// import Component from 'vue-class-component'
import {
  Component,
  Emit,
  Inject,
  Model,
  Prop,
  Provide,
  Vue,
  Watch
} from "vue-property-decorator";
@Component({
  // 引入子组件
  components: {}
})
export default class P2 extends Vue {
  // 初始化数据
  msg = 123;

  beforeCreate() {}
  created() {
    console.log(this);
  }
  beforeMount() {}
  mounted() {}

  // 计算属性 computedMsg为计算属性名字
  get computedMsg() {
    return "computed " + this.msg;
  }

  // 方法
  greet() {
    alert("greeting: " + this.msg);
  }
}
</script>
 
<style scoped>
</style>
